package com.huiben.app.cartoonbooks.base;

import android.os.Bundle;
import android.support.annotation.Nullable;

import com.linewow.xhyy.basiclibrary.base.BaseModel;
import com.linewow.xhyy.basiclibrary.base.BasePresenter;
import com.linewow.xhyy.basiclibrary.base.SuperBaseFragment;
import com.linewow.xhyy.basiclibrary.util.TUtil;

/**
 * Created by liuran on 2017/4/26.
 */

public abstract class BaseFragment <P extends BasePresenter,M extends BaseModel> extends SuperBaseFragment {

    protected P presenter;
    protected M model;

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        presenter= TUtil.getT(this,0);
        model=TUtil.getT(this,1);
        if(presenter!=null){
            presenter.context=context;
        }
        initPresenter();
    }

    protected abstract void initPresenter();
}
